<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作业1</title>
    <script type="text/javascript">
        function GetJD(){
            var a = document.getElementById("city");
             //获取节点的文本
             console.info("节点文本" + a.innerText);
            console.info("节点HTML" + a.innerHTML);
            //获取节点的值
            console.info("节点文本" + a.nodeName);
            console.info("节点文本" + a.nodeValue);
            
        }
    </script>
</head>
<body>
    <div id="city">
        <p style="color:#00f">旅游城市：</p>
        <ul id="city">
            <li id="bj" name="BeiJing">北京</li>
            <li>上海</li>
            <li id="chengDou">成都</li>
            <li>天津</li>
        </ul>
    </div>
</body>
</html>